﻿

@using UtilsBase;
@using UtilsCache;


@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" />
    <META HTTP-EQUIV="Expires" CONTENT="0" />
    <meta http-equiv="Cache" content="no-cache">

    <meta charset="UTF-8">
    <link rel="stylesheet" href="/common/css/login.css?2=1" />
    <title>@(UtilAppsettingCache.getSetting("MyWebSite:Name"))</title>
    <meta name="viewport" content="width=device-width" />
    <script>

      document.onkeydown = function(event_e){
          if(window.event) {
              event_e = window.event;
          }
          var int_keycode = event_e.charCode||event_e.keyCode;
          if( int_keycode == '13' ) {
              //your handler function,please.
              LogPost();
              return false;
          }
      }
    </script>
</head>
<body>
    
    <form id="subform" method="post" name="subform" action="/MagerLogin/login/">
  
        
            <div id="container">
    
                <div id="bd">
    
                    <div class="login">
                    <div class="login-top"><h1 class="logo"></h1></div>
                    <div class="login-input">
                        <p class="user ue-clear">
                            <label>用户名</label>
                            <input type="text" id="txt_Emp_Mobile" name="txt_Emp_Mobile" />
                        </p>
                        <p class="password ue-clear">
                            <label>密&nbsp;&nbsp;&nbsp;码</label>
                            <input type="password" id="txt_Emp_Pwd" name="txt_Emp_Pwd" />
                        </p>
                    </div>
                    <div class="login-btn ue-clear">
                        <a href="javascript:LogPost();" id="butLogin" name="butLogin" class="btn">登录</a>
                        <div class="remember ue-clear" style="display:none">
                            <input type="checkbox" id="remember" />
                            <em></em>
                            <label for="remember">记住密码</label>@ViewData["aa"]
                        </div>
                    </div>
                </div>
                <div style="margin:0px auto;width:100%;color:white;text-align:center;font-size:26px;display:none"></div>

            </div>
        </div>
        <div id="ft">
            推荐使用 Google Chrome浏览器 Copyright 
        </div>
    </form>
    <script type="text/javascript" src="/common/js/jquery.js"></script>
    <script src="/common/js/jquery-1.12.4.js"></script>
    <script type="text/javascript">

        function LogPost() {
           
            var Emp_Mobile1 =$("#txt_Emp_Mobile").val();
            var Emp_Pwd1 =$("#txt_Emp_Pwd").val();

            if (Emp_Mobile1 == "") {
                alert("请填写用户名/手机号");
                document.getElementById("txt_Emp_Mobile").focus();
                return;
            }
            if (Emp_Pwd1 == "") {
                alert("请填写密码");
                document.getElementById("txt_Emp_Pwd").focus();
                return;
            }
            $.post("/magerlogin/LoginCheck?from=@(ViewBag.FromUrl)", { Emp_Mobile: Emp_Mobile1, Emp_Pwd: Emp_Pwd1 }, function (result) {
                var jsonresult =eval(result);
                
                if (jsonresult[0].respCode == "200") {
                    window.location.href = jsonresult[0].url;
                }
                else {
                    alert(jsonresult[0].respMsg);
                    return;
                }
            });
        }
        var height = $(window).height();
        $("#container").height(height);
        $("#bd").css("padding-top", height / 2 - $("#bd").height() / 2);

        $(window).resize(function () {
            var height = $(window).height();
            $("#bd").css("padding-top", $(window).height() / 2 - $("#bd").height() / 2);
            $("#container").height(height);

        });

        $('#remember').focus(function () {
            $(this).blur();
        });

        $('#remember').click(function (e) {
            checkRemember($(this));
        });

        function checkRemember($this) {
            if (!-[1, ]) {
                if ($this.prop("checked")) {
                    $this.parent().addClass('checked');
                } else {
                    $this.parent().removeClass('checked');
                }
            }
        }
    </script>
</body>
</html>
